<div class="row-content layer-cf">
    <div class="row">
        <div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
            <div class="widget layer-cf">
                <div class="widget-head layer-cf">
                    <div class="widget-title a m-cf">管理员列表</div>
                </div>
                <div class="widget-body layer-fr">
                    <!-- 工具栏 -->
                    <div class="page_toolbar layer-margin-bottom-xs layer-cf">
                        <div class="layer-groups">
                                <div class="layer-btn-group layer-btn-group-xs">
                                    <a class="layer-btn layer-btn-default layer-btn-success"
                                       href="<?= url('store/adduser') ?>">
                                        <span class="mdi menu-icon mdi-plus"></span>新增
                                    </a>
                                </div>
									
                        </div>
                    </div>
                    <div class="layer-scrollable-horizontal layui-col-sm12">
                        <table width="100%" class="layer-table layer-table-compact layer-table-striped
                         tpl-table-black layer-text-nowrap">
                            <thead>
                            <tr>
                                <th>管理员ID</th>
                                <th>用户名</th>
                                <th>姓名</th>
                                <th>添加时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                                <tr>
                                    <td class="layer-text-middle"><?= $item['user_id'] ?></td>
                                    <td class="layer-text-middle"><?= $item['user_name'] ?></td>
                                    <td class="layer-text-middle"><?= $item['real_name'] ?></td>
                                    <td class="layer-text-middle"><?= $item['create_time'] ?></td>
                                    <td class="layer-text-middle">
                                        <div class="tpl-table-black-operation">												
										<a href="<?= url('store/editUser', ['user_id' => $item['user_id']]) ?>">
                                        <i class="mdi menu-icon mdi-pencil"></i> 编辑
                                            <?php if (($store['user']['user_id'] != $item['user_id'])
                                                && !$item['is_super']): ?>
                                                    <a href="javascript:void(0);"
                                                       class="item-delete tpl-table-black-operation-del"
                                                       data-id="<?= $item['user_id'] ?>">
														<i class="mdi menu-icon mdi-delete-forever"></i> 删除
                                                    </a>
                                            <?php endif; ?>
                                        </div>
                                    </td>
                                </tr>
                            <?php endforeach; else: ?>
                                <tr>
                                    <td colspan="5" class="layer-text-center">暂无记录</td>
                                </tr>
                            <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="layui-col-lg12 layer-cf">
                        <div class="layer-fr">{$list|raw}</div>
                        <div class="layer-fr pagination-total layer-margin-right">
                            <div class="layer-vertical-align-middle">总记录：<?= $list->total() ?></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {

        // 删除元素
        var url = "<?= url('store/deleteuser') ?>";
        $('.item-delete').delete('user_id', url, '删除后不可恢复，确定要删除吗？');

    });
</script>

